package com.parse;

public class Symbol {
    private String name; // 标识符名称
    private String type; // 标识符类型
    private Scope scope; // 标识符所在作用域

    public Symbol(String name, String type, Scope scope) {
        this.name = name;
        this.type = type;
        this.scope = scope;
    }

    public String getName() {
        return name;
    }

    public String getType() {
        return type;
    }

    public Scope getScope() {
        return scope;
    }

    public void setType(String type) {
        this.type = type;
    }

    // 重写 toString 方法，方便调试
    @Override
    public String toString() {
        return "Symbol{" +
                "name='" + name + '\'' +
                ", type='" + type + '\'' +
                ", scope=" + scope +
                '}';
    }

    public void setScope(Scope scope) {
        this.scope = scope;
    }
}

